package com.tiza.xiaoyoubao.ui.fragment;

import android.view.View;
import android.widget.TextView;

import com.tianze.library.base.BaseFragment;
import com.tiza.xiaoyoubao.R;
import com.tiza.xiaoyoubao.app.Constants;
import com.tiza.xiaoyoubao.entity.EditInfo;

import org.simple.eventbus.EventBus;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by mapple on 17/4/4.
 */

public class ChooseGenderFragment extends BaseFragment {

    @BindView(R.id.tv_boy)
    TextView tv_boy;
    @BindView(R.id.tv_girl)
    TextView tv_girl;

    private String gender;
    @Override
    protected int getLayoutId() {
        return R.layout.fragment_choose_gender;
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {

    }

   @OnClick({R.id.view_boy,R.id.view_girl})
    public void onClick(View view){
       switch (view.getId()){
           case R.id.view_boy:
               gender=tv_boy.getText().toString().trim();
               EventBus.getDefault().post(new EditInfo(EditInfo.TYPE_TAOBAO_GENDER, gender),
                                          Constants.TAG_SET_TAOBAO_SUCCESS
               );
               finish();
               break;
           case R.id.view_girl:
               gender=tv_girl.getText().toString().trim();
               EventBus.getDefault().post(new EditInfo(EditInfo.TYPE_TAOBAO_GENDER, gender),
                                          Constants.TAG_SET_TAOBAO_SUCCESS
               );
               finish();
               break;
           default:
               break;
       }
   }
}
